import datetime

from typing import Dict


class dbmodel:
    def load(self, obj):
        if not isinstance(obj, dict):
            raise TypeError("obj must be a dict")
        for k, v in obj.items():
            if hasattr(self, k):
                setattr(self, k, v)
        return self
